
#ifndef __WD_THREADPOOL_H__
#define __WD_THREADPOOL_H__

#include "tcp.h"
#include "pushfile.h"
#include "transferfile.h"
#include "getfile.h"
#include "mkdir.h"
#include "ls.h"
#include "rm.h"
#include "cd.h"
#include "pwd.h"


typedef struct {
	pthread_t * threads;
	int threadNumber;
	task_queue_t queue;
} thread_pool_t, *pThread_pool_t;

typedef void(*handleCmd)(int peerfd,char* cmd);

void * threadFunc(void*);

void threadpoolInit(thread_pool_t*, int);
void threadpoolDestroy(thread_pool_t*);
void threadpoolStart(thread_pool_t * pthreadpool);
 
int transferfile(int peerfd, const char * filename);
 

void cd(int peerfd, char* buf);
 
#endif
